package com.zzy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzy.domain.dto.WarehousingEntryDto;
import com.zzy.domain.po.WarehousingEntryDetails;
import com.zzy.domain.vo.PageResult;
import com.zzy.domain.vo.WarehousingEntryDetailsVo;
import com.zzy.mapper.WarehousingEntryDetailsMapper;
import com.zzy.service.WarehousingEntryDetailsService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WarehousingEntryDetailsServiceImpl extends ServiceImpl<WarehousingEntryDetailsMapper,WarehousingEntryDetails> implements WarehousingEntryDetailsService {
    /**
     * 按照批次号分页查询出数据
     * @param dto
     * @return
     */
    @Override
    public PageResult<WarehousingEntryDetailsVo> getpage(WarehousingEntryDto dto) {
        PageHelper.startPage(dto.getPage(),dto.getPageSize());
        List<WarehousingEntryDetailsVo>list=baseMapper.getpage(dto);
        Page<WarehousingEntryDetailsVo>page= (Page<WarehousingEntryDetailsVo>) list;
        return new PageResult<>(page.getTotal(),page.getResult());
    }
}
